package com.boot.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DebugController {

    @Autowired
    private ObjectMapper objectMapper; // 注入 Spring 管理的 ObjectMapper

    @GetMapping("/debug/objectmapper")
    public String debug() {
        return "Modules: " + objectMapper.getRegisteredModuleIds() + "\n" +
                "WRITE_DATES_AS_TIMESTAMPS: " + objectMapper.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
    }
}